How to gauge how many times Object Text has been modified?

I am aware that DOORS provides DXL built in for tracking how many times an object has been modified, days since last mod, days since creation, etc...

however, I currently have module with attributes that have nothing to do with tracking requirements volatility that affect change bars, thus history.

what I'd like to do is use the number of time Object text changes as a marker to a req volatility equation.

thanks in advance
Rich_Mason - Tue Nov 10 17:11:10 EST 2009

Re: How to gauge how many times Object Text has been modified?
llandale - Tue Nov 10 19:15:00 EST 2009

I'll code up a function without testing it, if you get it working post it back here.

//****************************
int    fCountHistory(Object obj, string NameAttr, Date datSince)
{     // Count the number of History records there are for the object,
        //      since the datSince, that modified the Attribute.
        // When datSince is null, ignore the history date
        // When NameAttr is null, count history for any attribute.
 
        // Only History in the Object's version of the module are considered,
        //      not History in other baselines.
 
        History hst
        int     CountHist = 0
 
        if (null obj) return(0)
 
        for hst in obj do
        {  if (hst.type != modifyObject)                      continue        // Wrong type of History
           if (!null datSince and hst.date < datSince)       continue        // History too old
           if (!null NameAttr and hst.attrName != NameAttr) continue    // Wrong Attr
 
           Count++                      // Found qualifying history
 
        }  // end for history in the Object
        return(Count)
}     // end fCountHistory()

 


Examples:
Count = fCountHistory(obj, "Object Text", Date null) // Count all Object Text changes
Count = fCountHistory(obj, "", Date "2009 July 4") // Count all obj-attr changes since 4 July.

 

 

  • Louie

 

Re: How to gauge how many times Object Text has been modified?
SystemAdmin - Wed Nov 11 06:43:12 EST 2009

Rich, From your statement, it appears your intended use of the data is for requirements volatility. If this is so, it appears you have asked the wrong question. The answer to your question could give your requirements volatility over 100 percent which is apparently wrong.

I suspect, you need to ask -- has this requirement changed since being approved and baselined and if so is the change significant enought to warrant being called a change.

I suspect for requirement volatility no one cares if someone bolded a shall or changed a typo. Therefore looking at history without doing a sanity check on history, provides you with data that is garbage for volatility metrics.

To get good metrics results -- you need to develop a process that is consistent with your companies needs and capabilities.

Re: How to gauge how many times Object Text has been modified?
Rich_Mason - Thu Nov 12 08:42:05 EST 2009

SystemAdmin - Wed Nov 11 06:43:12 EST 2009
Rich, From your statement, it appears your intended use of the data is for requirements volatility. If this is so, it appears you have asked the wrong question. The answer to your question could give your requirements volatility over 100 percent which is apparently wrong.

I suspect, you need to ask -- has this requirement changed since being approved and baselined and if so is the change significant enought to warrant being called a change.

I suspect for requirement volatility no one cares if someone bolded a shall or changed a typo. Therefore looking at history without doing a sanity check on history, provides you with data that is garbage for volatility metrics.

To get good metrics results -- you need to develop a process that is consistent with your companies needs and capabilities.

agreed, we are in the process of developing a process. I was just starting to think about how to use DOORS to easily do it. At our company, there is a large disconnect unfortunately between the engineers on a project updating requirements, and the DOORS database. DOORS is an afterthought more often than not.

I have not been able to make the script work yet, but I'll play with it some more. I'm not too strong on coding.

Re: How to gauge how many times Object Text has been modified?
Illo_993 - Thu Nov 12 10:33:58 EST 2009

Rich_Mason - Thu Nov 12 08:42:05 EST 2009
agreed, we are in the process of developing a process. I was just starting to think about how to use DOORS to easily do it. At our company, there is a large disconnect unfortunately between the engineers on a project updating requirements, and the DOORS database. DOORS is an afterthought more often than not.

I have not been able to make the script work yet, but I'll play with it some more. I'm not too strong on coding.

Hi Rich,

I just made the function working, added testing code and I did some fomatting:

/** ----------------------------------------------------------------------------
 * Counts the number of History records there are for the object,
 * since the dateSince, that modified the Attribute.
 * Hint:
 * Only History in the object's version of the module are considered,
 * not History in other baselines.
 *
 * @visiblity public
 * @state in work
 * @see 
 * @precondition 
 * @postcondition 
 *
 * @param obj - The object whose history shall be evaluated [in]
 * @param attrname - The name of the attribute which shall be evaluated, opt. [in]
 *                               If null modifications to all attributes are evaluated.
 * @param dateSince - The date since the history shall be evaluated, opt. [in]
 *                                        If null ignore the since date an take all history records in account.
 * @return The number of history entries which fit the given criteria
 */
int     countHistory( Object obj, string attrname, Date dateSince )
{
        // Check parameter
        if (null obj) return 0
 
        History hst = null
        int cnt = 0
 
        // Iterate over all history rcords of the object version
        for hst in obj do
        {  
                if (hst.type != modifyObject) continue   // Skip all history entries which do not relate to object modifications
                if (!null dateSince && (hst.date < dateSince)) continue      // Skip all history records which are too old
                if (!null attrname && (hst.attrName != attrname)) continue      // Skip all history records which do not relate to the referenced attribute
                
                cnt++                   // Found qualifying history
        }
        
        return cnt
}
 
 
//------------------------------------------------------------------
// Testing code
Object obj = current
string attr_name = "" // "Object Text"
Date dateSince = date( "12.11.2009 15:25:00", userLocale, "dd.MM.yyyy")
int     cnt = countHistory( obj, attr_name, dateSince )
print cnt

 


Cheers Illo